/* eslint-disable no-unused-vars */

const axios = require('axios').default
const gbk = require('gbk')

const Cookie0 = `3vy6_2132_saltkey=Y595RjRH; 3vy6_2132_lastvisit=1564392063; 3vy6_2132_nofavfid=1; 3vy6_2132_smile=1D1; 3vy6_2132_editormode_e=1; 3vy6_2132_auth=bf66AV2mHDsu0wuf8B58L0a90qmukf3PcJTx%2FYi1ZIzAeWlmLS%2FWijHMPy4ZumvrQ2EEyVR0H%2BxjnaqUv0F46EPXS1Y; 3vy6_2132_visitedfid=40D39D45D44D43D47D2; 3vy6_2132_ulastactivity=c8fa5zPsoIdBJiFoNxLi67Skar3h3IMz9YqeHCFzS3NA91pemXIN; 3vy6_2132_lastcheckfeed=171795%7C1565434722`
const Cookie1 = `3vy6_2132_saltkey=FS3h41jU; 3vy6_2132_lastvisit=1566658471; 3vy6_2132_auth=8ef9ecy0BfMEb0bcJW4P2JmJjA8vrPVeU0%2Bckm%2BLWIN6U%2FY0IXpJQZpIbLF6wsdXGDEgF95SWAmxBzP6%2FnalsoFGgG0; 3vy6_2132_nofavfid=1; 3vy6_2132_ulastactivity=24278joKve%2Fek4ufxVZpLorkIjTEuiCj58e1i274uhoabCpb0uPm; 3vy6_2132_lastcheckfeed=327729%7C1566780480`
const Cookie2 = `3vy6_2132_saltkey=TggJarTy; 3vy6_2132_lastvisit=1568600893; 3vy6_2132_sendmail=1; dialog=hide; 3vy6_2132_sid=R2fS4f; 3vy6_2132_seccode=183.d0b7a47e48295a0f04; 3vy6_2132_ulastactivity=e491KiKghmpKbL4wb7ewZY2DyMVCi0%2Fp%2FitBmYyOIaZTfZ6sntis; 3vy6_2132_auth=c113MGtNmfmim1%2BtlNtb%2BaIJfBD1R8wlDdSZmCxm8Xien%2FT170mfYhNG2VqWjWQTq%2B1o8aJtx993Y%2FVg1XeFgcg%2BzwA; 3vy6_2132_nofavfid=1; 3vy6_2132_lastact=1568604571%09home.php%09spacecp; 3vy6_2132_lastcheckfeed=193078%7C1568604571`
const Cookie3 = `3vy6_2132_saltkey=CMQchW2h; 3vy6_2132_lastvisit=1568601771; 3vy6_2132_sid=nhh25H; 3vy6_2132_ulastactivity=89d9lPwYhT9Zs5u7Hh7EosNzLcENNclZy0VGNmqP1Aog6AQ%2BwKFj; 3vy6_2132_auth=fea3a9Dog2dh0Eiuc7tTtKSnnilnEHnrJVqIA%2B2S6IK9yLj8c6jIi%2FWI97eZdfH%2FH%2Blx1hkpYqew3QElzu0AOt3eEGA; 3vy6_2132_lastcheckfeed=351084%7C1568605383; 3vy6_2132_checkfollow=1; 3vy6_2132_lip=112.17.247.236%2C1568605313; Example_auth=2ef2ddWihjvyeZiFW8eepqg5J%2BVz6SpZKZAJJ3LUslS6vPmH47eybg; 3vy6_2132_nofavfid=1; 3vy6_2132_checkpm=1; 3vy6_2132_lastact=1568605386%09home.php%09misc; 3vy6_2132_sendmail=1`

async function testLogin (Cookie) {
  await axios.get(`http://bbs.ra2ol.com/home.php`, {
    headers: {
      Cookie
    }
  })
  axios.get(`http://bbs.ra2ol.com/home.php?mod=spacecp&ac=credit&op=base`, {
    headers: {
      Cookie
    },
    responseType: 'arraybuffer',
    transformResponse: [
      (data) => {
        return gbk.toString('utf-8', data)
      }
    ]
  }).then(res => {
    console.log(res.data)
  })
}

testLogin(Cookie3)
